package org.example.dialogue.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.dialogue.mapper.ServiceConversationsMapper;
import org.example.dialogue.pojo.Conversations;
import org.example.dialogue.service.ServiceConversations;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zqtao
 */

@Service
public class ServiceConversationsImpl extends ServiceImpl<ServiceConversationsMapper, Conversations> implements ServiceConversations {
    @Override
    public List<Conversations> getHistoryMessage(Long userId) {
        LambdaQueryWrapper<Conversations> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Conversations::getUserId,userId);
        return baseMapper.selectList(wrapper);
    }
}
